/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package azhar.persistance;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Al-Insan
 */
@Entity
@Table(name = "siswa", catalog = "sms_center", schema = "")
@NamedQueries({
    @NamedQuery(name = "Siswa.findAll", query = "SELECT s FROM Siswa s"),
    @NamedQuery(name = "Siswa.findByIdSiswa", query = "SELECT s FROM Siswa s WHERE s.idSiswa = :idSiswa"),
    @NamedQuery(name = "Siswa.findByNis", query = "SELECT s FROM Siswa s WHERE s.nis = :nis"),
    @NamedQuery(name = "Siswa.findByNamaSiswa", query = "SELECT s FROM Siswa s WHERE s.namaSiswa = :namaSiswa"),
    @NamedQuery(name = "Siswa.findByCodeKelas", query = "SELECT s FROM Siswa s WHERE s.codeKelas = :codeKelas"),
    @NamedQuery(name = "Siswa.findByAlamat", query = "SELECT s FROM Siswa s WHERE s.alamat = :alamat"),
    @NamedQuery(name = "Siswa.findByNamaOrtu", query = "SELECT s FROM Siswa s WHERE s.namaOrtu = :namaOrtu"),
    @NamedQuery(name = "Siswa.findByNoHp", query = "SELECT s FROM Siswa s WHERE s.noHp = :noHp")})
public class Siswa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_siswa")
    private Integer idSiswa;
    @Column(name = "nis")
    private String nis;
    @Column(name = "nama_siswa")
    private String namaSiswa;
    @Column(name = "code_kelas")
    private Integer codeKelas;
    @Column(name = "alamat")
    private String alamat;
    @Column(name = "nama_ortu")
    private String namaOrtu;
    @Basic(optional = false)
    @Column(name = "no_hp")
    private String noHp;

    public Siswa() {
    }

    public Siswa(Integer idSiswa) {
        this.idSiswa = idSiswa;
    }

    public Siswa(Integer idSiswa, String noHp) {
        this.idSiswa = idSiswa;
        this.noHp = noHp;
    }

    public Siswa(Integer idSiswa, String nis, String namaSiswa, Integer codeKelas, String alamat, String namaOrtu, String noHp) {
        this.idSiswa = idSiswa;
        this.nis = nis;
        this.namaSiswa = namaSiswa;
        this.codeKelas = codeKelas;
        this.alamat = alamat;
        this.namaOrtu = namaOrtu;
        this.noHp = noHp;
    }

    

    public Integer getIdSiswa() {
        return idSiswa;
    }

    public void setIdSiswa(Integer idSiswa) {
        this.idSiswa = idSiswa;
    }

    public String getNis() {
        return nis;
    }

    public void setNis(String nis) {
        this.nis = nis;
    }

    public String getNamaSiswa() {
        return namaSiswa;
    }

    public void setNamaSiswa(String namaSiswa) {
        this.namaSiswa = namaSiswa;
    }

    public Integer getCodeKelas() {
        return codeKelas;
    }

    public void setCodeKelas(Integer codeKelas) {
        this.codeKelas = codeKelas;
    }

    public String getAlamat() {
        return alamat;
    }

    public void setAlamat(String alamat) {
        this.alamat = alamat;
    }

    public String getNamaOrtu() {
        return namaOrtu;
    }

    public void setNamaOrtu(String namaOrtu) {
        this.namaOrtu = namaOrtu;
    }

    public String getNoHp() {
        return noHp;
    }

    public void setNoHp(String noHp) {
        this.noHp = noHp;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSiswa != null ? idSiswa.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Siswa)) {
            return false;
        }
        Siswa other = (Siswa) object;
        if ((this.idSiswa == null && other.idSiswa != null) || (this.idSiswa != null && !this.idSiswa.equals(other.idSiswa))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "azhar.persistance.Siswa[idSiswa=" + idSiswa + "]";
    }

}
